Skip to content

Unit 10: 404 page — extract physics JS + CSS, self-host or SRI vendor scripts#12

Open
stradichenko wants to merge 1 commit intomainfrom
unit-10-404-refactor
Open

Unit 10: 404 page — extract physics JS + CSS, self-host or SRI vendor scripts#12
stradichenko wants to merge 1 commit intomainfrom
unit-10-404-refactor

Conversation

@stradichenko
Copy link
Copy Markdown
Owner

Summary

  • Extract inline <style> from 404.html into assets/css/404.css and replace hardcoded hex colors with theme tokens from core.css.
  • Extract the ~213-LOC inline physics simulation <script> into assets/js/404-cube.js, bundled with js.Build | minify | fingerprint.
  • For three.js + cannon.js, prefer self-hosted vendor copies. Added a partials/404/vendor-script.html helper that uses resources.GetRemote when network is available, otherwise emits the CDN <script> with SRI and crossorigin="anonymous".
  • defer all 404-page scripts. i18n the page strings.

Test plan

  • curl /404.html → contains 404-cube.js fingerprinted reference.
  • Cube animation renders.
  • No hardcoded hex outside core.css.

Part of the PKB-theme modernization batch (15 units).

- Extract inline <style> from 404.html into assets/css/404.css and
  replace hardcoded hex colors with theme tokens from core.css.
- Extract the ~213-LOC inline physics simulation <script> into
  assets/js/404-cube.js, bundled with js.Build | minify | fingerprint.
- For three.js + cannon.js, prefer self-hosted vendor copies (added a
  partials/404/vendor-script.html helper that uses resources.GetRemote
  when network is available, otherwise emits the CDN <script> with SRI
  and crossorigin=anonymous).
- defer all 404-page scripts.
- i18n the page strings (404 / page not found / error copy).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant